﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using SES.CMS.BL;
using SES.CMS.DO;
using System.Web.UI.HtmlControls;

namespace SES.CMS
{
    public partial class AlbumDetail : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            int id = 0;
            if (Request.QueryString["ID"] != null)
            {
                id = int.Parse(Request.QueryString["ID"].ToString());
                if (!IsPostBack)
                {
                    DataTable dt2 = new cmsImagesBL().SelectByAlbumID(id);
                    if (dt2.Rows.Count == 0)
                    {
                        lbImage.Text = "Hiện tại chưa có  ảnh!!";
                    }
                    else
                    {
                        lbImage.Visible = false;
                        rpt2.DataSource = dt2;
                        rpt2.DataBind();
                    }
                    HtmlMeta meta = new HtmlMeta();
                    meta.Name = "description";
                   
                    string host = Request.Url.Host;
                    if (host.ToLower().Equals("localhost") || host.ToLower().Equals("cayxanhdangviet.com"))
                    {
                        Page.Title = new cmsAlbumBL().Select(new cmsAlbumDO { AlbumID = id }).Title + " - " + Ultility.WebTitle(true);
                        meta.Content = Page.Title;
                    }
                    else
                    {

                        Page.Title = new cmsAlbumBL().Select(new cmsAlbumDO { AlbumID = id }).Title + " - " + Ultility.WebTitle(false);
                        meta.Content = Page.Title;
                    }
                    //;Ultility.PageTitle(int.Parse(Session["Lang"].ToString())); ;
                    Page.Header.Controls.Add(meta);

                    //lbDescription.Text = new cmsAlbumBL().Select(new cmsAlbumDO { AlbumID = id }).Title;
                }
            }
        }
        public string Change_AV(string ip_str_change)
        {
            return Ultility.Change_AV(ip_str_change);
        }
    }
}